 // 基于准备好的dom，初始化echarts实例
 var chartLeft = echarts.init(document.querySelector('.chart_left'));
 var chartRight = echarts.init(document.querySelector('.chart_right'));

 // 指定图表的配置项和数据
 var option1 = {
   title: {
     text: '2018年注册人数'
   },
   tooltip: {},
   legend: {
     data: ['人数']
   },
   xAxis: {
     data: ["1月", "2月", "3月", "4月", "5月", "6月"]
   },
   yAxis: {},
   series: [{
     name: '人数',
     type: 'bar',
     data: [1500, 2000, 3600, 1000, 1000, 2000]
   }]
 };
  var option2 = {
    title: {
      text: '热门品牌销售',
      subtext: '2018年6月',
      left: 'center',
    },
    tooltip: {
      trigger: 'item',
      formatter: '{a} <br/>{b} : {c} ({d}%)'
    },
    legend: {
      orient: 'vertical',
      data: ['李宁','优衣库','新百伦','阿迪王','阿迪'],
      left: 'left',
    },
    series: [{
      type: 'pie',
      radius: '55%',
      center: ['50%', '60%'],
      data: [{value:2000, name:'李宁'},
      {value:1548, name:'优衣库'},
      {value:135, name:'新百伦'},
      {value:235, name:'阿迪王'},
      {value:310, name:'阿迪'}]
    }]
  };

 // 使用刚指定的配置项和数据显示图表。
 chartLeft.setOption(option1);
 chartRight.setOption(option2);
